var e = require("../../../@babel/runtime/helpers/typeof"), t = getApp();

Page({
    data: {},
    onLoad: function(e) {
        this.getData();
    },
    num: function(e) {
        console.log(e.detail.value), this.setData({
            wholesale_unm: e.detail.value
        });
    },
    getData: function() {
        var e = this, n = t.getNetAddresss("plugin.pending-order.frontend.member-wholesale.point");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 == n.result ? e.setData({
                    info: n.data
                }) : (wx.showToast({
                    icon: "none",
                    title: n.msg,
                    duration: 1500
                }), setTimeout(function() {
                    wx.navigateBack({
                        delta: 1
                    });
                }, 1500));
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    pointSwap: function() {
        if (void 0 !== this.data.wholesale_unm) {
            console.log(e(this.data.wholesale_unm));
            var n = {
                wholesale_unm: this.data.wholesale_unm,
                activity_id: this.data.info.activity_id
            }, o = t.getNetAddresss("plugin.pending-order.frontend.member-wholesale.point-swap");
            t._getNetWork({
                url: o,
                data: n,
                success: function(e) {
                    var t = e.data;
                    1 == t.result && console.log(t);
                },
                fail: function(e) {
                    console.log(e);
                }
            });
        } else wx.showToast({
            title: "请输入兑换张数",
            icon: "none"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});